
package com.wa.nashorn;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NashornApiService {
    private static Map<String, NashornModuleApiService> apiServices;

    public NashornApiService() {
    }

    public static NashornModuleApiService getService(String serviceName) {
        return (NashornModuleApiService)apiServices.get(serviceName);
    }

    @Autowired(
        required = false
    )
    public void setApiServices(List<NashornModuleApiService> apiServices) {
        NashornApiService.apiServices = new HashMap();
        Iterator var2 = apiServices.iterator();

        while(var2.hasNext()) {
            NashornModuleApiService apiService = (NashornModuleApiService)var2.next();
            NashornApiService.apiServices.put(apiService.name(), apiService);
        }

    }
}
